<!DOCTYPE HTML>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<f:view>
  <f:metadata>
    <f:viewParam id="processDefinitionKey" name="processDefinitionKey" />
    <f:viewParam id="callbackUrl" name="callbackUrl" />
    <f:event type="preRenderView"
      listener="#{camundaTaskForm.startProcessInstanceByKeyForm(processDefinitionKey, callbackUrl)}" />
  </f:metadata>
  <h:head>
    <h:outputStylesheet library="webjars/bootstrap/2.3.2/css" name="bootstrap.css"/>
    <h:outputStylesheet library="css" name="style.css"  />
    <!-- if you need it - it is right there:
    <h:outputScript type="text/javascript" library="webjars/bootstrap/2.3.2/js" name="bootstrap.js" />    
    -->
    
    <title>Start Process: #{processDefinitionKey}</title>
  </h:head>
  <h:body>
      <div class="container">
        <div class="row quickstart-info">
            <h1>BPMN model API JSF form example</h1>
            <p>
                This examples shows a generic JSF form which gathers informations from the actual BPMN process definition.
            </p>
            <p>
                This form displays the <code>name</code> attribute of the start event as the title of the form.
                Also the button label is generated by the <code>name</code> attribute of the following user task.
            </p>
        </div>
        <div class="row quickstart-form">
          <h:form class="form-horizontal">
            <legend>#{startEventController.getStartEventName(processDefinitionKey)}</legend>
            <div class="control-group">
              <label class="control-label" for="inputName">Title:</label>
              <div class="controls">
                  <h:inputText disabled="false" id="inputName" value="#{processVariables['ticket-title']}" />
              </div>
            </div>
            <div class="control-group">
              <div class="controls">
                <h:commandButton id="submit_button" type="submit" value="#{startEventController.getUserTaskName(processDefinitionKey)}"
                  action="#{camundaTaskForm.completeProcessInstanceForm()}" styleClass="btn btn-primary" />
              </div>
            </div>
          </h:form>
        </div>
      </div>
  </h:body>
</f:view>
</html>
